package oop.pat;

//在Java中，所有的类，都默认直接或间接继承Object
public class Teacher extends Person {
    //public
    //protected
    //default
    //private
    private final String str = "CP";

    public Teacher() {
        //隐藏代码，默认调用父类的无参构造super()
        System.out.println("Teacher无参执行!");

    }

    public void print() {
        System.out.println("Teacher");
    }

    public void out(String str) {
        System.out.println(str);
        System.out.println(this.str);
        System.out.println(super.str);
    }

    public void test() {
        print();//Student
        this.print();//Student
        super.print();//Person
    }

}
